/*
+----------------------------------------------------------------------+
| NETWORK                                                                 |
+----------------------------------------------------------------------+
| Copyright © 2013 - 2018, The Machine Studio.                         |
+----------------------------------------------------------------------+
| See https://gitee.com/signorinotang/ServerStudy for last version     |
|                                                                      |
+----------------------------------------------------------------------+
| Author: Downey <Email: donney_luck@sina.cn>                        |
|                <QQ: 116297528>                                       |                                                                     |
+----------------------------------------------------------------------+
*/


#ifndef NETWORK_ENUMS_H
#define NETWORK_ENUMS_H

#include "core/Core.h"

namespace network {

    enum AddressType {
        ADDRESS_UNDEFINED,
        ADDRESS_IPV4,
        ADDRESS_IPV6
    };

    enum BSDSocketError {
        BSD_SOCKET_ERROR_NONE = 0,
        BSD_SOCKET_ERROR_CREATE_FAILED,
        BSD_SOCKET_ERROR_SOCKOPT_IPV6_ONLY_FAILED,
        BSD_SOCKET_ERROR_BIND_IPV6_FAILED,
        BSD_SOCKET_ERROR_BIND_IPV4_FAILED,
        BSD_SOCKET_ERROR_SET_NON_BLOCKING_FAILED
    };

    enum BSDSocketCounter {
        BSD_SOCKET_COUNTER_PACKETS_SENT,
        BSD_SOCKET_COUNTER_PACKETS_RECEIVED,
        BSD_SOCKET_COUNTER_SEND_FAILURES,
        BSD_SOCKET_COUNTER_SERIALIZE_WRITE_OVERFLOW,
        BSD_SOCKET_COUNTER_SERIALIZE_READ_OVERFLOW,
        BSD_SOCKET_COUNTER_PACKET_TOO_LARGE_TO_SEND,
        BSD_SOCKET_COUNTER_CREATE_PACKET_FAILURES,
        BSD_SOCKET_COUNTER_PROTOCOL_ID_MISMATCH,
        BSD_SOCKET_COUNTER_ABORTED_PACKET_READS,
        BSD_SOCKET_COUNTER_NUM_COUNTERS
    };
}

#endif
